<style lang="less" scoped>
  @import "../assets/css/config.less";
  .flex-row{
    display: flex;
    justify-content: start;
  }
  
  .redio-border{
    width: 7.625rem;
    height: 7.125rem;
    border: 1px solid #D9D9DC;
    margin-right: 0.9375rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    &.active{
      border: 1px solid @color1;
      box-shadow: 0 0 3px 0px @color1,0 0 6px 0px @color1;
      border-radius: 0.125rem;
    }

    .redio-btn{
      width: 14px;
      height: 14px;
      border: 1px solid #D9D9DC;
      border-radius: 50%;
      display: flex;
      justify-content: center;
      align-items: center;
      .point{
        width: 5px;
        height: 5px;
        background-color: @white;
        border-radius: 50%;
      }
      &.active{
        background-color: @color1;
      }
    }
    
    .pic{
      width: 80px;
      height: 50px;
      // border: 1px solid #D9D9DC;
      margin: 0.325rem;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    img{
      width: 50px;
      height: 50px;
    }
  }
</style>
<template>
  <div class="flex-row">
    <div class="redio-border" v-for="(item, index) in options" :key="index" :class="choose===index ? 'active' : ''" @click="chooseItem(index)">
      <div class="redio-btn" :class="choose===index ? 'active' : ''">
        <div class="point"></div>
      </div>
      <div class="pic">
        <img :src="item.img" alt="">
      </div>
      <div>{{ item.text }}</div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'RedioGroup',
  data() {
    return {
      choose: 0
    }
  },
  props: ['options'],

  methods: {
    chooseItem(index) {
      this.choose = index;
      this.$emit("getChoose",index)
    }
  }
}
</script>